home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
cnet
/
sysolm.lha
/
SysOLM.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-12-12
|
10KB
|
312 lines
/*
Automatically sends your callers certain OLMs during certain events.
The SysOp can add/remove OLMs, configure when they occur, and what they say.
> *** System Message ***
> New file just uploaded. Type "NF" to list.
> *** System Message ***
> Users have started a group-conference. To join, type "J" from the main-menu.
> *** System Message ***
> New vote-topic added. Type "VOTE" from the main-menu.
> *** System Message ***
> New caller just logged-in. Type "WHO" to list.
> *** System Message ***
> Caller just logged-out. Type "WHO" to list.
> *** System Message ***
> New-user just registered.
> *** System Message ***
> Network mail has arrived and is being unpacked.
> (System slow-down may occur.)
Each user can configure which System-OLMs he wishes to receive/avoid:
> [A] <OFF> Also ring bell during these System-OLMs?
> [B] <ON> New file just uploaded. Type 'NF' to list.
> [C] <ON> New message just posted. Type 'NM' to list.
> [D] <ON> New response just posted. Type 'NM' to list.
> [E] <ON> New vote-topic being added. Type 'VOTE' from the main-menu.
> [F] <OFF> New news/gfile/pfile added.
> [G] <ON> New caller just logged-in. Type 'WHO' to list.
> [H] <ON> Caller just logged-out. Type 'WHO' to list.
> [I] <ON> New-user starting the registration process.
> [J] <ON> New-user just completed the registration process.
> [K] <ON> Network mail is being processed.
> [L] <OFF> Network mail is done being processed.
> [M] <OFF> SysOp is now available for chats.
> [N] <ON> SysOp is no longer available for chats.
> [O] <ON> The system currently has ALL lines in use.
> [P] <ON> Polling for network mail.
> [Q] <OFF> Users have started a group-conference.
>
> Toggle which on/off (_BCDE_GHIJK__NOP_) [none]:
$VER: SysOLM.rexx v1.0 Sat 11-Dec-93 07:58:06
Written/tested with CNet v2.94beta
Installation:
1) Copy SysOLM.rexx TO pfiles:SysOLM.rexx
2) Add the following lines onto the END of the CNet:BBSmenu list
marked as "2; Available everywhere":
CFGOlm | {#4 rx Pfiles:SysOLM.rexx - %23}
3) Add the following lines onto the END of the CNet:BBSmenu list
marked as "1; Maintenance commands":
SYSOlm | {#4 rx Pfiles:SysOLM.rexx ? %23}
4) Edit the lines below marked "SysOp-settable variables".
5) Editing CNet:BBStext...
Now comes the hard part. You have to find, and change, the correct
lines within CNet:BBStext. Without any kind of documenation for BBStext,
I've only managed to find a few. If you find others, please post them.
In each of the following cases, change the 1st line into the 2nd line.
Post filed...
401> h6ed.n1
401> h6ed. #4 rx Pfiles:SysOLM.rexx C %23} n1
Response filed...
479> h6ed.n1
479> h6ed. {#4 rx Pfiles:SysOLM.rexx D %23} n1
New vote-topic being added...
1559> 100 float vote item [No]: ?0
1559> 100 float vote item [No]: ?0 {#4 rx Pfiles:SysOLM.rexx E %23}
New-user starting to register...
Add "{#4 rx Pfiles:SysOLM.rexx I %23}" into your "SysText:new/nu0" file.
I have an AmigaDOS-script that I run to process network mail.
In addition to calling the CNetTosser, I also added:
DOS> rx Pfiles:SysOLM.rexx K ; Send notice #K, "Start of process"
DOS> ... ; Call the tosser, whatever...
DOS> rx Pfiles:SysOLM.rexx L ; Send notice #L, "End of process"
------------------ End of installation info --------------------------------
SysOLM.rexx can be run online, or from the CLI.
If run online, it needs to know the user's port #. (Always use %23)
BBSTEXT {#4 rx Pfiles:SysOLM.rexx D %23} (Send string D during this event.)
BBSMENU {#4 rx Pfiles:SysOLM.rexx - %23} (Let user configure their set-up.)
BBSMENU {#4 rx Pfiles:SysOLM.rexx ? %23} (Let user pick 1 string to send.)
CLI rx Pfiles:SysOLM.rexx C (Send everyone string C.)
CLI rx Pfiles:SysOLM.rexx (Show menu of choices, pick, send.)
CLI rx Pfiles:SysOLM.rexx W ("W" isn't configured. Show menu.)
If you make many changes to your OLM-strings AFTER users have
configured their OLMs with CfgOLM, you many wish to force everyone to
re-configure their set-up.
Just execute the following cmd from the DOS prompt:
CLI> Delete Mail:Users/#?/SysOLM.cfg
Everyone's config-file will be deleted.
You can file-requ the latest release of this file under the MagicName
"SysOLM" from 1:2410/207 24hrs/day @14.4K.
SysOLM.rexx by
Bill Beogelein
Box 530441
Livonia, MI 48153
BBS 810-473-2020, Fido 1:2410/207
Ignore:
lz u CNet3:SysOLM.LHA CNet:rexx/SysOLM.rexx a:zzzBBSad Help:BB_CMDS
Copy CNet3:SysOLM.LHA UP:
Future ideas, or known bugs:
When SysOp uses this prg from the CLI, if user is sitting at
"More[Y,n,c]" prompt, this script can't continue until he hits
[RETURN].
Can't address CNETREXX0; 'sendString' "Any \n MCI codes..."
Have the online cmd prompt reappear after the OLM is displayed.
(Like CNet's own system-messages.) But how?
*/
/***************** Top of SysOp-settable variables ***************************/
header = "*** System-Message ***" /* "Header" is displayed BEFORE all msgs. */
olm.A = "Also ring bell during these System-OLMs?" /* BELL must be #A */
olm.B = "New file just uploaded. Type 'NF' to list."
olm.C = "New message just posted. Type 'NM' to list."
olm.D = "New response just posted. Type 'NM' to list."
olm.E = "New vote-topic being added. Type 'VOTE' from the main-menu."
olm.F = "New news/gfile/pfile added."
olm.G = "New caller just logged-in." /* Use CNet's "UM" instead */
olm.H = "Caller just logged-out." /* Use CNet's "UM" instead */
olm.I = "New-user starting the registration process."
olm.J = "New-user just completed the registration process."
olm.K = "Network mail is being processed. System slow-down may occur."
olm.L = "Network mail is done being processed."
olm.M = "SysOp is now available for chats."
olm.N = "SysOp is no longer available for chats."
olm.O = "The system currently has ALL lines in use. System slow-down may occur."
olm.P = "Polling for network mail."
olm.Q = "Users have started a group-conference. To join, type 'J' from the main-menu."
olm.R = ""
olm.S = ""
olm.T = ""
olm.U = ""
olm.V = ""
olm.W = ""
olm.X = ""
olm.Y = ""
olm.Z = ""
/* "Footer" is displayed AFTER all msgs. */
footer = "(Type 'CfgOLM' to suppress these System-Messages.)"
minline = 0 /* Lowest line # that gets System-Messages (0-99) */
maxline = 40 /* Highest line # that gets System-Messages (0-99) */
bell = 0 /* Bell rings (0=REMOTE ONLY; 1=LOCAL+REMOTE screens) */
log = 1 /* Write activity to log? (0=NO; 1=YES) */
/******************** End of SysOp-settable variables ****************************/
options results
NO = (1==0)
YES = (1==1)
parse arg which port
which = upper(strip(which))
port = strip(port)
cli = NO
if(port="") then
do
port=999
cli=YES /* Running from the CLI */
end
portname="CNETREXX" || port
LF = '0a'x
if( which='-' ) then /* Just load/configure/save */
do
address value portname
call LoadCfg()
do forever
'transmit' LF " SysOLM.rexx by Bill Beogelein" LF
max=0
do ii=1 to 26
ch=d2c(ii+64)
if(olm.ch=="") then leave
if( pos(ch, cfg)>0 ) then status="<ON> "; else status="<OFF>"
'transmit' "[" || ch || "]" status left(olm.ch, 62)
max=max+1
end
'sendString' LF || "Toggle which on/off (" || left(cfg, max) || ") [none]: "
'getChar'; ans=RESULT; 'transmit' ans
if( ans<'A' | ans>d2c(max+64) ) then leave
pp=c2d(ans)-64
if( substr(cfg, pp, 1) = ans ) then
cfg=overlay('_', cfg, pp, 1)
else
cfg=overlay(ans, cfg, pp, 1)
end
call SaveCFG()
exit
end
if( olm.which=="" | which=="" | which=="?" ) then /* Pick 1 and send it */
do
say LF " SysOLM.rexx by Bill Beogelein" LF
do ii=1 to 26
ch=d2c(ii+64)
if(olm.ch=="") then leave
say "[" || ch || "]" left(olm.ch, 74)
end
call writeCH(STDOUT, LF || "Send which [none]: ")
which=upper(readLN(STDIN))
if(which=="") then exit
cli=YES /* Maybe online, too */
end
do ii=minline to maxline
portname="CNETREXX" || ii
if( show(PORTS, portname) ) then loaded=YES; else loaded=NO
if( ii=port ) then myport=YES; else myport=NO
if( loaded & ~myport) then
do
address value portname
call LoadCFG()
if(inuse) then
do
if( pos(which, cfg)>0 ) then
do
str = "Port" right(ii, 2) ": Receiving msg" which
if(cli) then say str
call ToLog(str)
'transmit' LF LF || header LF olm.which LF || footer
if( left(cfg, 1)='A' ) then BEEP = '07'x; else BEEP = ""
if(bell) then 'sendString' BEEP; else 'sendModem' BEEP
end
else
do
str = "Port" right(ii, 2) ": Suppressing msg" which
if(cli) then say str
call ToLog(str)
end
end
end
end
exit /****** End of main ******/
LoadCfg:
/* address value portname */
cfg="ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* Default for new acct is "bell ON" */
'getUser' 39; home = RESULT
cfgname= "Mail:Users/" || home || "/SysOLM.cfg"
/* 'transmit' cfg home cfgname x which x */
'getCarrier'; if( RESULT="TRUE" ) then inuse=YES; else inuse=NO
if(inuse) then
do
if(open(fp, cfgname, 'READ')) then
do
cfg=readLN(fp)
call close(fp)
end
end
return
SaveCfg:
if(open(fp, cfgname, 'WRITE')) then
do
call writeLN(fp, cfg)
'transmit' LF || "Saving your setting (" || left(cfg, max) || ") to" cfgname
call ToLog("CFG set to" cfg)
call close(fp)
end
else
'transmit' LF || "*** Can't open" cfgname "for write."
return
ToLog:
parse arg str
if(log) then 'LogEntry' "SysOLM.rexx :" str
return
/*** EOF SysOLM.rexx 810-473-2020 ***/